<!--
 * @Description: 工程交底审核
 * @Author: wangwangwang
 * @Date: 2020-11-18 15:34:16
 * @LastEditors: wangwangwang
 * @LastEditTime: 2021-03-29 11:04:25
-->
<template>
  <div class="flows-content">
    <el-container>
      <el-main style="margin-bottom: 20px; padding: 0;">
        <el-container direction="vertical">
          <FlowHeader :isReadOnly="readOnly" @saveSubmit="handleSubmit(1)" @sendSubmit="handleSubmit(2)" @handleBackEnd="handleSubmit(3)" @handleCC="handleSubmit(4)" @handleAssign="handleSubmit(5)" @handleBackUp="handleSubmit(6)" @handleAssist="handleSubmit(7)" @handleNode="handleSubmit(8)" @handleNodeImage="handleSubmit(9)" @handleCollection="handleSubmit(10)" />
          <el-main class="info">
            <div>
              <el-input v-model="title" class="flow-title" :disabled="readOnly" placeholder="请输入流程标题"></el-input>
            </div>
            <div class="info-top">
              <div class="left">
                <span>单据号码：{{ billCode }}</span>
                <span class="text">制单日期：{{ billDate }}</span>
              </div>
              <div class="right">
                <span>发起人：{{ applyPerson }}</span>
                <span class="text">状态：{{taskTypeText[taskStatus*1]}}</span>
              </div>
            </div>
            <div class="dialoginfo" style="margin-top:10px;">
              <div class="dialoginfo-title">
                <div :class="type == 0 ? 'active' : 'none'" @click="type = 0">
                  <div>销售信息</div>
                </div>
                <div v-if="caiwu" :class="type == 1 ? 'active' : 'none'" @click="type = 1">
                  <div>财务信息</div>
                </div>
                <div v-if="shengchan" :class="type == 2 ? 'active' : 'none'" @click="type = 2">
                  <div>生产信息</div>
                </div>
              </div>
              <div class="dialoginfo-info">
                <!-- 销售信息 -->
                <div v-show="type === 0">
                  <el-form ref="projectForm" :model="projectForm" label-width="120px" label-position="right" hide-required-asterisk disabled>
                    <div class="form-title">
                      <div>基本工程信息</div>
                    </div>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">交底类型</span>
                          <el-select :key="projectForm.discloseType" v-model="projectForm.discloseType" placeholder="请选择">
                            <el-option label="委托交底" :value="1"></el-option>
                            <el-option label="合同交底" :value="2"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">工程名称</span>
                          <el-input v-model="projectForm.enginnerrName"></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item prop="enginnerrNatureId">
                          <span slot="label" style="color: #ff0000">工程性质</span>
                          <el-select ref="enginnerrNature" v-model="projectForm.enginnerrNatureId" placeholder="请选择" @change="$nextTick(()=>{projectForm.enginnerrNature = $refs.enginnerrNature.selectedLabel})">
                            <el-option v-for="(item, index) in enginnerrNatureIdList" :key="index" :label="item.itemName" :value="item.id"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">工程地址</span>
                          <el-input v-model="projectForm.enginnerrAddress"></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">行政区</span>
                          <el-cascader v-model="projectForm.administrativeDistrictsId0" style="width:432px;" :options="treeData" filterable></el-cascader>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">联营标识</span>
                          <el-select v-model="projectForm.poolFlag" placeholder="请选择">
                            <el-option label="是" value="1"></el-option>
                            <el-option label="否" value="0"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">内外标识</span>
                          <el-radio-group v-model="projectForm.sidesFlag">
                            <el-radio :label="1">内</el-radio>
                            <el-radio :label="2">外</el-radio>
                          </el-radio-group>
                          <el-select v-if="projectForm.sidesFlag==2" :key="projectForm.sidesFlagType" v-model="projectForm.sidesFlagType" placeholder="请选择" style="width:263px;margin-left:20px;">
                            <el-option label="央企" :value="1"></el-option>
                            <el-option label="地方企业" :value="2"></el-option>
                            <el-option label="其他" :value="3"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">协调主体</span>
                          <el-input v-model="projectForm.coordinateName"></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="24">
                        <el-form-item label-width="150px">
                          <span slot="label">工程现场特性描述</span>
                          <el-input v-model="projectForm.enginnerrLiveDescription"></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="施工单位">
                          <el-input v-model="projectForm.constructionCompany"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="委托单位">
                          <el-input v-model="projectForm.contractCompany"></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="委托期">
                          <el-date-picker v-model="projectForm.entrustBeginTImeEntrustEndTime" style="width:390px;" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" @change="projectForm.entrustBeginTime=projectForm.entrustBeginTImeEntrustEndTime[0]||'',projectForm.entrustEndTime=projectForm.entrustBeginTImeEntrustEndTime[1]||''">
                          </el-date-picker>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="委托量">
                          <el-input v-model="projectForm.entrusNumber"><template slot="append">方</template></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label">合同号</span>
                          <el-input v-model="projectForm.contractNo"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="施工工期">
                          <el-date-picker v-model="projectForm.constructionStartDateConstructionEndDate" style="width:390px;" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" @change="projectForm.constructionStartDate=projectForm.constructionStartDateConstructionEndDate[0]||'',projectForm.constructionEndDate=projectForm.constructionStartDateConstructionEndDate[1]||''">
                          </el-date-picker>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label">质监备案号</span>
                          <el-input v-model="projectForm.qiRecord"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">合同单位</span>
                          <el-select ref="businesName" v-model="projectForm.businesNameId" placeholder="请选择" @change="$nextTick(()=>{projectForm.businesName = $refs.businesName.selectedLabel})">
                            <el-option v-for="item in roadWorkList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="合同总量">
                          <el-input v-model="projectForm.contractSumNumber"><template slot="append">方</template></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="合同含税总价">
                          <el-input v-model="projectForm.contractPriceOfFax"><template slot="append">元</template></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">合同生效日期</span>
                          <el-date-picker v-model="projectForm.effectiveDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期时间" style="width:390px;">
                          </el-date-picker>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">合同有效期</span>
                          <el-date-picker v-model="projectForm.firstIndateEndIndate" style="width:390px;" type="daterange" range-separator="至" start-placeholder="开始日期" value-format="yyyy-MM-dd" end-placeholder="结束日期" @change="projectForm.firstIndate=projectForm.firstIndateEndIndate[0]||'',projectForm.endIndate=projectForm.firstIndateEndIndate[1]||''">
                          </el-date-picker>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">合同模式</span>
                          <el-select :key="projectForm.modelOfContract" v-model="projectForm.modelOfContract" placeholder="请选择">
                            <el-option label="包干" :value="1"></el-option>
                            <el-option label="代工" :value="2"></el-option>
                            <el-option label="其他" :value="3"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">预算员</span>
                          <el-select ref="budgetPerson" v-model="projectForm.budgetPersonId" placeholder="请选择" @change="$nextTick(()=>{projectForm.budgetPerson = $refs.budgetPerson.selectedLabel})">
                            <el-option v-for="(item,k) in budgetPersonIdList" :key="k" :label="item.name" :value="item.id"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">销售员</span>
                          <el-select ref="saller" v-model="projectForm.sallerId" placeholder="请选择" @change="$nextTick(()=>{projectForm.saller = $refs.saller.selectedLabel})">
                            <el-option v-for="(item,k) in sallerIdList" :key="k" :label="item.name" :value="item.id"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="处别">
                          <el-select ref="placeType" v-model="projectForm.placeTypeId" placeholder="请选择" @change="$nextTick(()=>{projectForm.placeType = $refs.placeType.selectedLabel})">
                            <el-option v-for="(item, index) in placeTypeList" :key="index" :label="item.itemName" :value="item.id"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label-width="160px">
                          <span slot="label" style="color: #ff0000">甲方项目负责人及权限</span>
                          <el-input v-model="projectForm.firstLeader"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">我司合同签字人</span>
                          <el-select ref="ourCompanyCheckPerson" v-model="projectForm.ourCompanyCheckPersonId" placeholder="请选择" @change="$nextTick(()=>{projectForm.ourCompanyCheckPerson = $refs.ourCompanyCheckPerson.selectedLabel})">
                            <el-option v-for="(item, index) in ourCompanyCheckPersonIdList" :key="index" :label="item.name" :value="item.id"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="甲方有权对量">
                          <el-input v-model="projectForm.richAmount"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">甲方小票签收人</span>
                          <el-select ref="firstPartySigner" v-model="projectForm.firstPartySignerId" placeholder="请选择" @change="$nextTick(()=>{projectForm.firstPartySigner = $refs.firstPartySigner.selectedLabel})">
                            <el-option v-for="(item, index) in firstPartySignerIdList" :key="index" :label="item.name" :value="item.id"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label">甲方指定邮箱</span>
                          <el-input v-model="projectForm.firstPartyMailbox"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label">乙方指定邮箱</span>
                          <el-input v-model="projectForm.secondPartyMailbox"></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="质量约定">
                          <el-select ref="qualityAgreement" v-model="projectForm.qualityAgreementId" placeholder="请选择" @change="$nextTick(()=>{projectForm.qualityAgreement = $refs.qualityAgreement.selectedLabel})">
                            <el-option v-for="(item, index) in qualityAgreementIdList" :key="index" :label="item.name" :value="item.id"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="收款方式">
                          <el-select v-model="projectForm.clearingForms" multiple>
                            <el-option label="银行现金转账" :value="1"></el-option>
                            <el-option label="银行转账汇票" :value="2"></el-option>
                            <el-option label="银行转账汇票" :value="3"></el-option>
                            <el-option label="供应链金融产品" :value="4"></el-option>
                            <el-option label="其他" :value="5"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="24">
                        <el-form-item label="发票约定">
                          <el-input v-model="projectForm.ticketAgree" rows='3' type="textarea"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="24">
                        <el-form-item label="串换约定">
                          <el-input v-model="projectForm.circulateAgreed"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="24">
                        <el-form-item label="签证约定">
                          <el-input v-model="projectForm.visaAgreed"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="24">
                        <el-form-item label="交底备注">
                          <el-input v-model="projectForm.disclosureNotes"></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>

                    <div class="form-title">产品信息</div>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">强度等级</span>
                          <el-select v-model="projectForm.strengthGradeArr" multiple placeholder="请选择" @change="$forceUpdate()">
                            <el-option v-for="item in strengthGradeList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="性能等级">
                          <el-select v-model="projectForm.performanceRateArr" multiple placeholder="请选择" @change="$forceUpdate()">
                            <el-option v-for="item in performanceGradeList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="材料要求">
                          <el-select v-model="projectForm.materialRequirementsArr" multiple placeholder="请选择" @change="$forceUpdate()">
                            <el-option v-for="item in meterialRequirementsList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="特殊要求">
                          <el-select v-model="projectForm.specialRequirementsArr" multiple placeholder="请选择" @change="$forceUpdate()">
                            <el-option v-for="item in specialRequirementsList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="其他要求">
                          <el-select v-model="projectForm.otherRequirementsArr" multiple placeholder="请选择" @change="$forceUpdate()">
                            <el-option v-for="item in otherRequirementsList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="外加剂要求">
                          <el-select v-model="projectForm.admixtureRequirementsArr" multiple placeholder="请选择" @change="$forceUpdate()">
                            <el-option v-for="item in admixtureRequirementsList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">浇筑方式</span>
                          <el-select v-model="projectForm.pumpTypeArr" multiple placeholder="请选择" @change="$forceUpdate()">
                            <el-option v-for="item in pumpTypeList" :key="item.id" :label="item.itemName" :value="item.id"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">小方量约定</span>
                          <el-input v-model="projectForm.smallVolume" type="Number">
                            <template slot="append">方/车</template>
                          </el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">约定容重</span>
                          <el-input v-model="projectForm.unitWeight" type="Number"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="甲供材料">
                          <el-radio-group v-model="projectForm.armorForMaterials">
                            <el-radio :label="0">无</el-radio>
                            <el-radio :label="1">有</el-radio>
                          </el-radio-group>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <div v-if="projectForm.armorForMaterials==1">
                      <div style="padding-bottom: 10px;">
                        <el-button size="mini" class="bottom_all" style="margin-left: 0;" @click="addItem()">
                          <i class="icon iconfont iconicon_button_add" style="font-size: 12px;"></i>
                          添加
                        </el-button>
                      </div>
                      <el-table :header-cell-style="{ background: '#f3f6f9' }" :cell-style="{ borderRight: 'none' }" border stripe style="width:100%" :data="projectForm.list" tooltip-effect="dark">
                        <el-table-column label="甲供材料名称" align="center" width="150">
                          <template slot-scope="scope">
                            <span v-if="scope.row.materials" class="table_link" style="cursor:pointer;" @click="ListChoiceTypeFun(scope.$index,scope.row.materialsId)">{{scope.row.materials}}</span>
                            <span v-else class="table_link" style="cursor:pointer;" @click="ListChoiceTypeFun(scope.$index)">选择</span>
                          </template>
                        </el-table-column>
                        <el-table-column label="型号" align="center" prop="specification" width="auto"></el-table-column>
                        <el-table-column label="单方掺量" align="center">
                          <template slot-scope="scope">
                            <el-input-number v-model="scope.row.mixingAmount" :precision="0" style="width: 100%;" :controls="false"></el-input-number>
                          </template>
                        </el-table-column>
                        <el-table-column label="操作" align="left" prop="specification" width="100">
                          <template slot-scope="scope">
                            <el-button size="mini" class="bottom_two" @click="deleteItem(scope.$index)">
                              <i class="icon iconfont iconicon_button_delete" style="font-size: 12px;"></i>
                              删除
                            </el-button>
                          </template>
                        </el-table-column>
                      </el-table>
                    </div>
                    <div v-if="jiaodifile">
                      <div class="form-title">交底附件</div>
                      <div style="padding-left:50px;">
                        <div class="form-title">合同相关文件</div>
                        <FileComponent fileCode="contractFile2" :files="listFilesa1" @deleteFile="deleteFile1" @uplodeSuccess="uplodeSuccess1" />
                      </div>
                    </div>
                  </el-form>
                </div>
                <!-- 财务信息 -->
                <div v-show="type === 1" style="padding:0px 130px;">
                  <el-form ref="projectForm" :model="projectForm" label-width="120px" label-position="right" hide-required-asterisk :disabled="!caiwu">
                    <div class="form-title">
                      <div>财务信息</div>
                    </div>
                    <div>
                      <el-form-item label="建委合同号" label-width="120px">
                        <span slot="label" style="color: #ff0000">财务编码</span>
                        <el-input v-model="projectForm.financialCode" style="width: 250px;"></el-input>
                      </el-form-item>
                    </div>
                  </el-form>
                </div>
                <!-- 生产信息 -->
                <div v-show="type === 2" style="padding:0px 130px;">
                  <el-form ref="projectForm" :model="projectForm" label-width="120px" label-position="right" hide-required-asterisk :disabled="!shengchan">
                    <div class="form-title">
                      <div>生产信息</div>
                    </div>
                    <el-row>
                      <el-form-item label="建委合同号">
                        <span slot="label" style="color: #ff0000">建委合同号</span>
                        <el-input v-model="projectForm.ccContractNo" style="width: 250px;"></el-input>
                      </el-form-item>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">主供应站点</span>
                          <el-select ref="selection1" v-model="projectForm.mainSupplySiteId" style="width: 250px;" placeholder="请选择" @change="$nextTick(()=>{projectForm.mainSupplySite = $refs.selection1.selectedLabel})">
                            <el-option v-for="item in pointIdList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item>
                          <span slot="label" style="color: #ff0000">主供应站点距离</span>
                          <el-input v-model="projectForm.mainSupplySiteDistence" type="Number" style="width: 250px;"><template slot="append">千米</template></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="20">
                        <el-form-item>
                          <span slot="label">增值服务项</span>
                          <span>{{servicePoint}}</span>
                        </el-form-item>
                      </el-col>
                      <el-col :span="4">
                        <el-button class="bottom_two" style="margin-left:25px;" @click="choiseBussinessPoint()">更改</el-button>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="辅供应站点">
                          <el-select ref="secondSupplySite" v-model="projectForm.secondSupplySiteId" style="width: 250px;" placeholder="请选择" @change="$nextTick(()=>{projectForm.secondSupplySite = $refs.secondSupplySite.selectedLabel})">
                            <el-option v-for="item in pointIdList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="辅供应站点距离">
                          <el-input v-model="projectForm.secondSupplySiteDistence" style="width: 250px;"></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                  </el-form>
                </div>
              </div>
              <div style="color: #ff0000; font-size: 12px; padding-top: 9px">
                请确认以上交底信息填写完整！
              </div>
            </div>
            <div class="flows-details">
              <FlowContent ref="flowcontent" :title="title" :showSendVisible="showSendVisible" @handleCancel="handleCancel" @sendCode="sendCode" @handleFinish="handleFinish" @handleBusiness="handleBusiness" @setElement="setElement" @submitData="submitDataType" />
            </div>
          </el-main>
        </el-container>
      </el-main>
    </el-container>
    <!-- 管控业务点 -->
    <el-dialog v-dialogDrag :visible.sync="bussinessVisible" width="60%">
      <span slot="title" class="dialog-title">管控业务点</span>
      <el-checkbox-group v-model="buspointids">
        <template v-for="(item,index) in buspointArr">
          <div :key="index" class="checkbox-bg">
            <el-checkbox :label="item.id">{{item.itemName}}</el-checkbox>
          </div>
        </template>
      </el-checkbox-group>
      <span slot="footer" class="dialog-footer" @change="(a,b)=>{aa(a,b,c)}">
        <el-button class="bottom_all_two" @click="bussinessVisible = false">关 闭</el-button>
        <el-button class="bottom_all" @click="handlePoint">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import treeData from '@/views/platform/ICPS/basicConfig/address.js';
import FileComponent from '@/components/File/fileComponent';
import FlowContent from "@/components/WorkFlow/flowContent";
import FlowHeader from '@/components/WorkFlow/flowHeader';
import { queryProcesses } from "@/api/basicConfig/proflow.js";
import {
  UpdatePingGu,
} from "@/api/internetSales/projectClarifi.js";
import { getUserInfo } from "@/utils/auth.js";
import { queryAllByCompanyId } from '@/api/internetSales/chanceManagement'
import { getLists } from "@/api/smart/schedul/c.js";
import { getDicType, getListByTypeId, getDicsType, getStationByCompanyId } from "@/api/common.js";
import { get_simple_user_listBycompanyId } from '@/api/GHnumber/contract'
import {
  saveOrUpdateDisclose,
} from "@/api/internetSales/projectClarifi.js";
export default {
  components: {
    FlowContent,
    FileComponent,
    FlowHeader,
  },
  data() {
    return {
      treeData,
      type: 0,
      executePhase: '',
      title: "工程交底审核",
      billCode: "",
      billDate: "",
      applyPerson: "",
      taskTypeText: ['发起', '已保存', '审批中', '已完成', '撤销', '不通过'],
      taskStatus: '',
      readOnly: false,
      showSendVisible: false,
      projectForm: {
        // 基础信息
        engineeringId: '',
        discloseType: '',
        enginnerrName: '',
        enginnerrNature: '',
        enginnerrNatureId: '',
        clearingForms: [],
        enginnerrAddress: '',
        administrativeDistrictsId: '',
        administrativeDistrictsId0: '',
        administrativeDistrictsName: '',
        poolFlag: '',
        sidesFlagType: '',
        sidesFlag: 1,
        coordinateName: '',
        enginnerrLiveDescription: '',
        constructionCompany: '',
        contractCompanyId: '',
        contractCompany: '',
        entrustBeginTImeEntrustEndTime: [],
        entrustBeginTime: '',
        entrustEndTime: '',
        entrusNumber: '',
        contractNo: '',
        constructionStartDateConstructionEndDate: [],
        constructionStartDate: '',
        constructionEndDate: '',
        qiRecord: '',
        firstIndateEndIndate: [],
        firstIndate: '',
        endIndate: '',
        modelOfContract: '',
        budgetPersonId: '',
        budgetPerson: '',
        budgetPersonDepartmentId: '',
        saller: '',
        sallerId: '',
        placeType: '',
        placeTypeId: '',
        servicePoint: [],
        firstLeader: '',
        ourCompanyCheckPerson: '',
        ourCompanyCheckPersonId: '',
        richAmount: '',
        firstPartySigner: '',
        firstPartySignerId: '',
        firstPartyMailbox: '',
        secondPartyMailbox: '',
        qualityAgreement: '',
        qualityAgreementId: '',
        clearingForm: '',
        clearingFormId: '',
        ticketAgree: '',
        circulateAgreed: '',
        VisaAgreed: '',
        disclosureNotes: '',
        strengthGrade: '',//强度等级
        strengthGradeArr: [],//强度等级
        performanceRate: '',//性能等级
        performanceRateArr: [],//性能等级
        materialRequirements: '',//材料要求
        materialRequirementsArr: [],//材料要求
        specialRequirements: '',//特殊要求
        specialRequirementsArr: [],//特殊要求
        otherRequirements: '',//其他要求
        otherRequirementsArr: [],//其他要求
        admixtureRequirements: '',//外加剂要求
        admixtureRequirementsArr: [],//外加剂要求
        pumpType: '',//泵送方式
        pumpTypeArr: [],//泵送方式
        smallVolume: '',
        unitWeight: '',
        armorForMaterials: 0,
        financialCode: '',
        ccContractNo: '',
        mainSupplySiteId: '',
        mainSupplySite: '',
        mainSupplySiteDistence: '',
        secondSupplySite: '',
        secondSupplySiteId: '',
        secondSupplySiteDistence: '',
        list: [],//甲供材料列表
        fileFist: [],//附件
      },
      ourCompanyCheckPersonIdList: [],//公司人员
      budgetPersonIdList: [],//预算员
      sallerIdList: [],//销售员
      firstPartySignerIdList: [],//用料签收员
      qualityAgreementIdList: [],//质量约定
      listFilesa1: [],
      disAddCosts: [],
      strengthGradeList: [], //强度list
      performanceGradeList: [], //性能等级list
      meterialRequirementsList: [], //材料要求list
      specialRequirementsList: [], //特殊要求list
      otherRequirementsList: [], // 其他要求list
      admixtureRequirementsList: [], //外加剂要求list
      pumpTypeList: [],//浇筑方式泵机类型
      enginnerrNatureIdList: [],//工程性质
      placeTypeList: [],//处别
      contractTypeIdList: [],//合同类型
      pointIdList: [],//主供应站点
      roadWorkList: [],//合同单位
      positionList: [], // 岗位列表
      servicePoint: '',
      bussinessVisible: false,
      buspointArr: [],
      buspointids: [],
      caiwu: false,
      jiaodifile: false,
      shengchan: false,
      companyId: '',
      company: '',
    };
  },
  created() {
    this.treeData.forEach((v) => {
      v.children.forEach((res) => {
        res.children.forEach((res2) => {
          delete res2.children
        })
      })
    })
    /**质量约定list */
    getDicType({ code: "TheQualityAgreement" }).then((res) => {
      if (res.data) {
        this.qualityAgreementIdList = res.data.items;
      }
    });
    /**浇筑方式泵机类型 */
    getDicType({
      code: "castingType",
    }).then((res) => {
      res.data.items.map((v1) => v1.type = 1);
      this.pumpTypeList = res.data.items
      getDicType({
        code: "pouringMethod",
      }).then((res) => {
        res.data.items.map((v2) => v2.type = 2)
        this.pumpTypeList = [...this.pumpTypeList, ...res.data.items];
      });
    });
    /**
     * @Description: 获取5大参数
     * @Param: 
     * @Author: wangwangwang
     */
    getLists().then((res) => {
      res.data.forEach((item) => {
        if (!item) return
        if (item.typeName == "强度等级") {
          this.strengthGradeList = item.list;
        } else if (item.typeName == "规范性能等级") {
          this.performanceGradeList = item.list;
        } else if (item.typeName == "材料要求") {
          this.meterialRequirementsList = item.list;
        } else if (item.typeName == "特殊要求") {
          this.specialRequirementsList = item.list;
        } else if (item.typeName == "外加剂要求") {
          this.admixtureRequirementsList = item.list;
        } else if (item.typeName == "其他要求") {
          this.otherRequirementsList = item.list;
        }
      });
    });
    /**
     * @Description: 获取强度等级
     * @Param: 
     * @Author: wangwangwang
     */
    getListByTypeId({
      typeId: 1,
    }).then((res) => {
      this.arr1 = res.data;
    });
    /**
     * @Description: 获取数据字典
     * @Param: 
     * @Author: wangwangwang
     */
    getDicsType({ codes: "EngineeringNature,contractType,MATname,castingType,shutdownLogo, placeDon, recordFixedPostition, market" }).then((res) => {
      if (res.code === 1001) {
        this.enginnerrNatureIdList = res.data.EngineeringNature.items;
        this.contractTypeIdList = res.data.contractType.items;
        this.arr2 = res.data.MATname.items;
        this.shutdownLogoList = res.data.shutdownLogo.items;
        this.placeTypeList = res.data.placeDon.items;
        this.fixPosition = res.data.recordFixedPostition.items;
        this.buspointArr = res.data.market.items;
      }
    });
    /**
     * @Description: 获取施工单位
     * @Param: 
     * @Author: wangwangwang
     */
    queryAllByCompanyId().then(res => {
      if (res.code === 1001) {
        this.roadWorkList = res.data;
      }
    })
  },
  methods: {
    saveBaseInfo() {
      /**
       * 保存基本交底信息
       * @param  {[type]} params1).then(( [description]
       * @return {[type]}                 [description]
       */
      this.projectForm.fileFist = [...this.listFilesa1];
      this.projectForm.strengthGrade = JSON.stringify(this.projectForm.strengthGradeArr ?.map((v) => {
        let obj = { id: v, name: this.strengthGradeList.find((v2) => v2.id == v).name }
        return obj
      }))
      this.projectForm.performanceRate = JSON.stringify(this.projectForm.performanceRateArr ?.map((v) => {
        let obj = { id: v, name: this.performanceGradeList.find((v2) => v2.id == v).name }
        return obj
      }))
      this.projectForm.materialRequirements = JSON.stringify(this.projectForm.materialRequirementsArr ?.map((v) => {
        let obj = { id: v, name: this.meterialRequirementsList.find((v2) => v2.id == v).name }
        return obj
      }))
      this.projectForm.specialRequirements = JSON.stringify(this.projectForm.specialRequirementsArr ?.map((v) => {
        let obj = { id: v, name: this.specialRequirementsList.find((v2) => v2.id == v).name }
        return obj
      }))
      this.projectForm.otherRequirements = JSON.stringify(this.projectForm.otherRequirementsArr ?.map((v) => {
        let obj = { id: v, name: this.otherRequirementsList.find((v2) => v2.id == v).name }
        return obj
      }))
      this.projectForm.admixtureRequirements = JSON.stringify(this.projectForm.admixtureRequirementsArr ?.map((v) => {
        let obj = { id: v, name: this.admixtureRequirementsList.find((v2) => v2.id == v).name }
        return obj
      }))
      this.projectForm.pumpType = JSON.stringify(this.projectForm.pumpTypeArr ?.map((v) => {
        let obj = { id: v, name: this.pumpTypeList.find((v2) => v2.id == v).itemName, type: this.pumpTypeList.find((v2) => v2.id == v).type }
        return obj
      }))
      if (this.projectForm.clearingForms ?.length > 0) {
        this.projectForm.clearingForm = this.projectForm.clearingForms.join(',');
      } else {
        this.projectForm.clearingForm = ''
      }
      if (this.projectForm.entrustBeginTime) {
        this.projectForm.entrustBeginTImeEntrustEndTime = [this.projectForm.entrustBeginTime, this.projectForm.entrustEndTime]
      }
      if (this.projectForm.constructionStartDate) {
        this.projectForm.constructionStartDateConstructionEndDate = [this.projectForm.constructionStartDate, this.projectForm.constructionEndDate]
      }
      this.projectForm.firstIndateEndIndate = [this.projectForm.firstIndate, this.projectForm.endIndate]
      saveOrUpdateDisclose(this.projectForm)
    },
    /**
     * @Description: 选择管控业务点
     * @Param: 通过选中的站点获取默认选中数据
     * @Author: wangwangwang
     */
    choiseBussinessPoint() {
      if (!this.projectForm.mainSupplySiteId) {
        this.$message.warning('请选择主供应站点后再进行操作')
        return
      }
      this.bussinessVisible = true;
      if (this.projectForm?.servicePoint) {
        const newData = this.projectForm.servicePoint ? JSON.parse(this.projectForm.servicePoint) : [];
        const copyData = newData.filter(item => item.type * 1 === 1);
        this.buspointids = copyData.map(item => item.id);
      } else {
        queryProcesses({ stationId: this.projectForm?.mainSupplySiteId }).then(res => {
          if (res.code === 1001) {
            const newData = res.data.servicePoint ? JSON.parse(res.data.servicePoint) : [];
            const copyData = newData.filter(item => item.type * 1 === 1);
            this.buspointids = copyData.map(item => item.id);
          }
        })
      }
    },
    handlePoint() {
      const newData = this.buspointArr.filter(item => this.buspointids.some(items => item.id === items));
      this.servicePoint = newData.map(item => item.itemName).join(',');
      this.projectForm.servicePoint = JSON.stringify(newData.map(item => ({ id: item.id, name: item.itemName, type: 1 })));
      this.bussinessVisible = false;
    },
    deleteFile1(index) {
      this.listFilesa1.splice(index, 1);
    },
    /**
     * @Description: 上传成功
     * @Param: 
     * @Author: wangwangwang
     */
    uplodeSuccess1(data) {
      const params = {
        name: data.fileName,
        fileName: data.fileName,
        fileUrl: data.fileUrl,
        path: data.fileUrl,
        fileType: 1,
        type: 1,
        createTime: new Date().Format('yyyy-MM-dd hh:mm:ss'),
      }
      this.listFilesa1.push(params);
    },
    // administrativeDistrictsIdFun(value, label, extra) {
    //   this.projectForm.administrativeDistrictsId = JSON.stringify([extra.triggerNode.$parent.$parent.$options.propsData.value, extra.triggerNode.$parent.$options.propsData.value, value])
    //   this.$forceUpdate()
    // },
    handleBusiness() {
      this.projectForm.fileFist = this.listFilesa1;
      if (this.projectForm.strengthGradeArr.length > 0) {
        this.projectForm.strengthGrade = JSON.stringify(this.projectForm.strengthGradeArr.map((v) => {
          let obj = { id: v, name: this.strengthGradeList.find((v2) => v2.id == v).name }
          return obj
        }))
      }
      if (this.projectForm.performanceRateArr.length > 0) {
        this.projectForm.performanceRate = JSON.stringify(this.projectForm.performanceRateArr.map((v) => {
          let obj = { id: v, name: this.performanceGradeList.find((v2) => v2.id == v).name }
          return obj
        }))
      } else {
        this.projectForm.performanceRate = ''
      }
      if (this.projectForm.materialRequirementsArr.length > 0) {
        this.projectForm.materialRequirements = JSON.stringify(this.projectForm.materialRequirementsArr.map((v) => {
          let obj = { id: v, name: this.meterialRequirementsList.find((v2) => v2.id == v).name }
          return obj
        }))
      } else {
        this.projectForm.materialRequirements = ''
      }
      if (this.projectForm.specialRequirementsArr.length > 0) {
        this.projectForm.specialRequirements = JSON.stringify(this.projectForm.specialRequirementsArr.map((v) => {
          let obj = { id: v, name: this.specialRequirementsList.find((v2) => v2.id == v).name }
          return obj
        }))
      } else {
        this.projectForm.specialRequirements = ''
      }
      if (this.projectForm.otherRequirementsArr.length > 0) {
        this.projectForm.otherRequirements = JSON.stringify(this.projectForm.otherRequirementsArr.map((v) => {
          let obj = { id: v, name: this.otherRequirementsList.find((v2) => v2.id == v).name }
          return obj
        }))
      } else {
        this.projectForm.otherRequirements = ''
      }
      if (this.projectForm.admixtureRequirementsArr.length > 0) {
        this.projectForm.admixtureRequirements = JSON.stringify(this.projectForm.admixtureRequirementsArr.map((v) => {
          let obj = { id: v, name: this.admixtureRequirementsList.find((v2) => v2.id == v).name }
          return obj
        }))
      } else {
        this.projectForm.admixtureRequirements = ''
      }
      if (this.projectForm.pumpTypeArr.length > 0) {
        this.projectForm.pumpType = JSON.stringify(this.projectForm.pumpTypeArr.map((v) => {
          let obj = { id: v, name: this.pumpTypeList.find((v2) => v2.id == v).itemName, type: this.pumpTypeList.find((v2) => v2.id == v).type }
          return obj
        }))
      } else {
        this.projectForm.pumpType = ''
      }
      this.projectForm.companyId = this.companyId
      this.projectForm.company = this.company
      if (this.projectForm.clearingForms ?.length > 0) {
        this.projectForm.clearingForm = this.projectForm.clearingForms.join(',');
      } else {
        this.projectForm.clearingForm = ''
      }
      if (this.projectForm.entrustBeginTime) {
        this.projectForm.entrustBeginTImeEntrustEndTime = [this.projectForm.entrustBeginTime, this.projectForm.entrustEndTime]
      }
      if (this.projectForm.constructionStartDate) {
        this.projectForm.constructionStartDateConstructionEndDate = [this.projectForm.constructionStartDate, this.projectForm.constructionEndDate]
      }
      this.projectForm.firstIndateEndIndate = [this.projectForm.firstIndate, this.projectForm.endIndate]
      const params = {
        process_success: {
          url: '/icps/system/sign/cloudSell/disclose/saveOrUpdateDisclose',
          data: {...this.projectForm, statusNum: 4},
          httpMethod: 'post',
        },
        process_failure: {
          url: '/icps/system/sign/cloudSell/engineeringManagement/UpdatePingGu',
          data: {
            engineeringId: this.projectForm.engineeringId,
            statusNum: 3,
            statusType: this.executePhase,
          },
          httpMethod: 'post',
        }
      }
      this.showSendVisible = false;
      this.$refs.flowcontent.handleToFlow(params);
    },
    /**
     * @Description:
     * @Param: 1为保存，2为最后提交
     * @Author: wangwangwang
     * @param {*} type
     */
    handleFinish(type, status) {
      if (type === 2 && status * 1 === 2) {
        UpdatePingGu({
          engineeringId: this.projectForm.engineeringId,
          statusNum: 4,
          statusType: this.executePhase,
        });
      }
    },
    handleSubmit(type) {
      const { query } = this.$route;
      if (query.type * 1 === 2 && type === 2 && query.taskType * 1 !== 2) {
        // 财务审批
        if (!this.projectForm.financialCode && this.caiwu) {
          this.$message.warning('财务编码不能为空');
          return
        }
        if ((!this.projectForm.ccContractNo || !this.projectForm.mainSupplySiteId || !this.projectForm.mainSupplySiteDistence) && this.shengchan) {
          this.$message.warning('生产信息存在必填数据未填写');
          return
        }
        if (this.caiwu) {
          this.saveBaseInfo()
        }
        if (this.shengchan) {
          this.saveBaseInfo()
        }
        this.showSendVisible = true;
        return;
      }
      const data = {
        dataSource: "ProjectClarifiFlow",
        dataContent: JSON.stringify({formData: this.projectForm, fileList1: this.listFilesa1, companyId: this.companyId, company: this.company, executePhase: this.executePhase}), // 业务数据
      };
      this.$refs.flowcontent.saveFlows(type, data);
    },
    submitDataType() {
      UpdatePingGu({
        engineeringId: this.projectForm.engineeringId,
        statusNum: 2,
        statusType: this.executePhase,
        secondaryStatus: 1,
      });
    },
    handleFlowChat() {
      this.$refs.flowcontent.showFlowNode()
    },
    handleCancel() {
      this.showSendVisible = false;
    },
    /**
     * @Description: 处理审批要素
     * @param {*}
     * @Author: wangwangwang
     */
    setElement(data) {
      for (let i = 0; i < data.length; i += 1) {
        if (data[i].code === 'caiwu') {
          this.caiwu = data[i].hideType === '1'
        }
        if (data[i].code === 'jiaodifile') {
          this.jiaodifile = data[i].hideType === '1'
        }
        if (data[i].code === 'shengchan') {
          this.shengchan = data[i].hideType === '1'
        }
      }
    },
    /**
     * @Description: 回显业务数据
     * @Param:
     * @Author: wangwangwang
     */
    initFlowsData() {
      this.isReadOnly = true;
      const { query } = this.$route;
      const { formData, fileList1, companyId, company, executePhase }  = query;
      this.listFilesa1 = JSON.parse(fileList1);
      this.companyId = companyId;
      this.company = company;
      this.projectForm = JSON.parse(formData);
      this.executePhase = executePhase;
      /*根据公司获取站点*/
      getStationByCompanyId({ id: companyId }).then((res) => {
        this.pointIdList = res.data.map((v) => {
          return {
            id: v.stationId,
            name: v.stationName
          }
        })
      });
      /*我司合同签字人*/
      get_simple_user_listBycompanyId({
        roleId: '7605679267385344',
        orgznizationId: companyId
      }).then((res) => {
        this.ourCompanyCheckPersonIdList = res.data;
      });
      /*获取预算员*/
      get_simple_user_listBycompanyId({
        roleId: '48d84b503be7484ca1b5c2eade1ff004',
        orgznizationId: companyId
      }).then((res) => {
        this.budgetPersonIdList = res.data;
      });
      /*获取销售员*/
      get_simple_user_listBycompanyId({
        roleId: '12b2f6ff304148fd89141e9faa9afb96',
        orgznizationId: companyId
      }).then((res) => {
        this.sallerIdList = res.data;
      });
      /*获取用料签收员*/
      get_simple_user_listBycompanyId({
        roleId: '3e32ac0a1e95449d91d80bd97bd30ec7',
      }).then((res) => {
        this.firstPartySignerIdList = res.data;
      });
      const newData = this.projectForm.servicePoint ? JSON.parse(this.projectForm.servicePoint) : [];
      const copyData = newData.filter(item => item.type == 1);
      this.servicePoint = copyData.map(item => item.name).join(',');
      // getDisClostDetail({ id }).then((res) => {
      //   if (res.data) {
      //     this.projectForm = res.data;
      //     if (this.projectForm.discloseType == 1) {
      //       this.executePhase = 1
      //     } else {
      //       this.executePhase = 4
      //     }
      //     /*根据公司获取站点*/
      //     getStationByCompanyId({ id: this.projectForm.companyId }).then((res) => {
      //       this.pointIdList = res.data.map((v) => {
      //         return {
      //           id: v.stationId,
      //           name: v.stationName
      //         }
      //       })
      //     });
      //     /*我司合同签字人*/
      //     get_simple_user_listBycompanyId({
      //       roleId: '7605679267385344',
      //       orgznizationId: this.projectForm.companyId
      //     }).then((res) => {
      //       this.ourCompanyCheckPersonIdList = res.data;
      //     });
      //     console.log(JSON.parse(JSON.stringify(this.projectForm)))
      //     /*获取预算员*/
      //     get_simple_user_listBycompanyId({
      //       roleId: '48d84b503be7484ca1b5c2eade1ff004',
      //       orgznizationId: this.projectForm.companyId
      //     }).then((res) => {
      //       this.budgetPersonIdList = res.data;
      //       console.log(JSON.parse(JSON.stringify(this.budgetPersonIdList)))
      //     });
      //     /*获取销售员*/
      //     get_simple_user_listBycompanyId({
      //       roleId: '12b2f6ff304148fd89141e9faa9afb96',
      //       orgznizationId: this.projectForm.companyId
      //     }).then((res) => {
      //       this.sallerIdList = res.data;
      //     });
      //     /*获取用料签收员*/
      //     get_simple_user_listBycompanyId({
      //       roleId: '3e32ac0a1e95449d91d80bd97bd30ec7',
      //       // orgznizationId: this.data.companyId
      //     }).then((res) => {
      //       this.firstPartySignerIdList = res.data;
      //     });
      //     if (this.projectForm.administrativeDistrictsId) {
      //       this.projectForm.administrativeDistrictsId0 = JSON.parse(this.projectForm.administrativeDistrictsId)//行政区
      //     }
      //     this.projectForm.strengthGradeArr = JSON.parse(this.projectForm.strengthGrade) ?.map((v) => v.id)//强度等级
      //     this.projectForm.performanceRateArr = JSON.parse(this.projectForm.performanceRate) ?.map((v) => v.id)//性能等级
      //     this.projectForm.materialRequirementsArr = JSON.parse(this.projectForm.materialRequirements) ?.map((v) => v.id)//材料要求
      //     this.projectForm.specialRequirementsArr = JSON.parse(this.projectForm.specialRequirements) ?.map((v) => v.id)//特殊要求
      //     this.projectForm.otherRequirementsArr = JSON.parse(this.projectForm.otherRequirements) ?.map((v) => v.id)//其他要求
      //     this.projectForm.admixtureRequirementsArr = JSON.parse(this.projectForm.admixtureRequirements) ?.map((v) => v.id)//外加剂要求
      //     this.projectForm.pumpTypeArr = JSON.parse(this.projectForm.pumpType) ?.map((v) => v.id)//泵送方式
      //     if (this.projectForm.entrustBeginTime) {
      //       this.projectForm.entrustBeginTImeEntrustEndTime = [this.projectForm.entrustBeginTime, this.projectForm.entrustEndTime]
      //     }
      //     if (this.projectForm.constructionStartDate) {
      //       this.projectForm.constructionStartDateConstructionEndDate = [this.projectForm.constructionStartDate, this.projectForm.constructionEndDate]
      //     }
      //     if (this.projectForm.clearingForm) {
      //       this.projectForm.clearingForms = this.projectForm.clearingForm.split(',').map(Number)
      //     }
      //     this.projectForm.firstIndateEndIndate = [this.projectForm.firstIndate, this.projectForm.endIndate]
          
      //     //合同回显组装
      //     const Arry1 = [];
      //     const Arry2 = [];
      //     for (let i = 0; i < res.data.fileFist.length; i += 1) {
      //       if (res.data.fileFist[i].fileType === '1') {
      //         const data = {
      //           name: res.data.fileFist[i].fileName,
      //           fileName: res.data.fileFist[i].fileName,
      //           fileUrl: res.data.fileFist[i].path,
      //           path: res.data.fileFist[i].path,
      //           fileType: 1,
      //           type: 1,
      //         }
      //         Arry1.push(data);
      //       }
      //       if (res.data.fileFist[i].fileType === '2') {
      //         const data = {
      //           name: res.data.fileFist[i].fileName,
      //           fileName: res.data.fileFist[i].fileName,
      //           fileUrl: res.data.fileFist[i].path,
      //           path: res.data.fileFist[i].path,
      //           fileType: 2,
      //           type: 1,
      //         }
      //         Arry2.push(data);
      //       }
      //     }
      //     this.listFilesa1 = Arry1;
      //     this.listFilesa2 = Arry2;
      //   }
      // });
    },
    initFlowsData2 () {
      const { query } = this.$route;
      this.title = query.taskName;
      this.billCode = query.receiptNumber;
      this.billDate = query.createTime;
      this.applyPerson = query.createUserName;
      this.taskStatus = query.taskStatus;
      const data = JSON.parse(query.dataContent);
      const { formData, fileList1, companyId, company, executePhase }  = data;
      this.listFilesa1 = fileList1;
      this.companyId = companyId;
      this.company = company;
      this.projectForm = formData;
      this.executePhase = executePhase;
      /*根据公司获取站点*/
      getStationByCompanyId({ id: companyId }).then((res) => {
        this.pointIdList = res.data.map((v) => {
          return {
            id: v.stationId,
            name: v.stationName
          }
        })
      });
      /*我司合同签字人*/
      get_simple_user_listBycompanyId({
        roleId: '7605679267385344',
        orgznizationId: companyId
      }).then((res) => {
        this.ourCompanyCheckPersonIdList = res.data;
      });
      /*获取预算员*/
      get_simple_user_listBycompanyId({
        roleId: '48d84b503be7484ca1b5c2eade1ff004',
        orgznizationId: companyId
      }).then((res) => {
        this.budgetPersonIdList = res.data;
      });
      /*获取销售员*/
      get_simple_user_listBycompanyId({
        roleId: '12b2f6ff304148fd89141e9faa9afb96',
        orgznizationId: companyId
      }).then((res) => {
        this.sallerIdList = res.data;
      });
      /*获取用料签收员*/
      get_simple_user_listBycompanyId({
        roleId: '3e32ac0a1e95449d91d80bd97bd30ec7',
      }).then((res) => {
        this.firstPartySignerIdList = res.data;
      });
      const newData = this.projectForm.servicePoint ? JSON.parse(this.projectForm.servicePoint) : [];
      const copyData = newData.filter(item => item.type == 1);
      this.servicePoint = copyData.map(item => item.name).join(',');
    },
    sendCode(code) {
      this.billCode = code;
    },
  },
  mounted() {
    getDicsType({ codes: "EngineeringNature" }).then((res) => {
      if (res.code === 1001) {
        this.enginnerrNatureIdList = res.data.EngineeringNature.items;
      }
    });
    const { query } = this.$route;
    if (query.type == 1) {
      // 发起流程
      this.initFlowsData();
      this.applyPerson = getUserInfo().userRealName;
      this.$refs.flowcontent.initBaseData("ProjectClarifiFlow");
      this.billDate = new Date().Format("yyyy-MM-dd hh:mm:ss");
      return;
    }
    this.initFlowsData2();
    this.readOnly = true;
  },
};
</script>
<style lang="scss" scoped>
.flows-details {
  margin-top: 20px;
}
.info {
  padding: 0 20px;
  background: #fff;
  .info-top {
    font-size: $font_size;
    color: #000000;
    @include discen_al;
    justify-content: space-between;
    height: 50px;
    border-bottom: 1px #e1e5ed solid;
    .left {
      @include discen_al;
    }
    .text {
      margin-left: 60px;
    }
  }
}
.nav_title {
  @include discen_al;
  align-items: flex-end;
  > div {
    width: 4px;
    height: 24px;
    background: $bg_color;
    margin-right: 10px;
  }
  i {
    margin-left: 5px;
  }
  color: $bg_color;
  font-size: 20px;
  font-weight: bold;
}
.dialoginfo {
  padding: 0;
}
.active {
  border-top: 1px #e1e5ed solid;
  border-right: 1px #e1e5ed solid;
  border-left: 1px #e1e5ed solid;
  background: #fff;
}
.dialoginfo-info {
  border-right: 1px #e1e5ed solid;
  border-left: 1px #e1e5ed solid;
  border-bottom: 1px #e1e5ed solid;
}
/*弹窗*/
.dialoginfo-title {
  > div {
    cursor: pointer;
  }
  height: 48px;
  display: flex;
  background: linear-gradient(
    180deg,
    rgba(250, 252, 255, 1) 0%,
    rgba(245, 247, 250, 1) 100%
  );
  .none {
    font-weight: bold;
    height: 48px;
    @include discen;
    width: calc(calc(100% - 1px) / 2);
    border-bottom: 1px solid #e1e5ed;
    > div {
      line-height: 48px;
      border-bottom: 1px rgba(0, 0, 0, 0) solid;
    }
  }
  .center {
    width: 1px;
    height: 48px;
    background: #e1e5ed;
  }
  .active {
    font-weight: bold;
    height: 48px;
    @include discen;
    width: calc(calc(100% - 1px) / 2);
    border-bottom: 1px solid rgba(0, 0, 0, 0);
    > div {
      color: $bg_color;
      line-height: 48px;
      border-bottom: 1px $bg_color solid;
    }
  }
}
.dialoginfo-info {
  padding: 10px 20px;
  overflow: auto;
  height: calc(85vh - 282px);
  .el-select,
  .el-input,
  .el-date-picker {
    width: 100%;
  }
}
.form-title {
  font-size: 18px;
  margin: 10px 0;
  display: flex;
  justify-content: space-between;
}
.checkbox-bg {
  margin: 0 10px 10px 10px;
  display: inline-block;
}
</style>
